// oms 订单管理部分 接口
import request from '@/utils/axios'
import {
    URL_API
  } from '@/utils/mUtils'
  const base = URL_API()
// 创建订单接口
export function addstate(params) {
    return request({
        url: `${base}/api/order/create`,
        method: 'post',
        data: params,

    })
}
// 订单详情接口
export function order_details(params) {
    return request({
        url: `${base}/api/order/detail`,
        method: 'post',
        data: params,

    })
}
// 修改订单接口
export function updateorder_details(params) {
    return request({
        url: `${base}/api/order/update`,
        method: 'post',
        data: params,

    })
}
// 获取订单数据列表
export function reqOrderFormData(params) {
    return request({
        url: `${base}/api/order/list`,
        method: 'post',
        data: params,
    })
}
// 
// 传递货物信息
export function customer_goods(params) {
    return request({
        url: `${base}/api/customer/goods`,
        method: 'post',
        data: params
    })
}
// 生成订单编号
export function ranDom() {
    return request({
        url: `${base}/api/customer/random`,
        method: 'get'
    })
}

// 回显订单
export function OrdewEcho(params) {
    return request({
        url: `${base}/api/customer/find/order_code?order_code=${params.order_code}&token=${params.token}`,
        method: 'get',
    })
}
// 删除订单
export function deleteOrder(params) {
    return request({
        url: `${base}/api/order/delete`,
        method: 'post',
        data: params
    })
}

//修改订单
export function modifyOrder(list) {
    return request({
        url: `${base}/api/customer/put`,
        method: 'post',
        data: list
    })
}
// 受理
export function assignmentStatus(params) {
    return request({
        url: `${base}/api/order/action/accept`,
        method: 'post',
        data: params
    })
}


// 取消受理
export function cancelAcceptance(params) {
    return request({
        url: `${base}/api/order/action/cancel/accept`,
        method: 'post',
        data: params
    })
}

// 订单作废
export function procRejection(params) {
    return request({
        url: `${base}/api/order/action/void`,
        method: 'post',
        data: params
    })
}
// 订单取消作废

export function cancelRejection(params) {
    return request({
        url: `${base}/api/order/action/cancel/void`,
        method: 'post',
        data: params
    })
}
// 导出

export function download(params) {
    return request({
        url: `${base}/api/customer/download`,
        method: 'get',
        data: params
    })
}
// 导入

export function customerImport(params) {
    return request({
        url: `${base}/api/order/import`,
        method: 'post',
        headers: { 'Content-Type': 'multipart/form-data' },
        data: params
    })
}
// 导入数据请求的的接口
export function recordList(params) {
    return request({
        url: `${base}/api/import/record/list`,
        method: 'post',
        data: params
    })
}
//搜索
export function reqSearchOrders(params, title, token) {
    return request({
        url: `${base}/api/customer/list?${title}=${params}&token=${token}`,
        method: 'get'
    })
}
// 自定义打印模板
export function importField() {
    return request({
        url: `${base}/api/customer/importField`,
        method: 'get'
    })
}
// 下载模板
export function downloadDemo(params) {
    return request({
        url: `${base}/api/customer/download_demo?field_list=${params}`,
        method: 'get',
    })
}
// 导出数据
export function reqExportNotice(params) {
    return request({
        url: `${base}/api/order/export`,
        method: 'post',
        data: params
    })
}

//温度数据工具页的api
// 订单号的展示
export function reqOrdersCode(params) {
    return request({
        url: `${base}/api/customer/list?token=${params}&is_all=all`,
        method: 'get'
    })
}

//模糊查询
export function reqOrderTemp(params) {
    return request({
        url: `${base}/api/customer/fuzzy_query?query_str=${params.str}&token=${params.token}`,
        method: 'get'
    })
}

//选中订单号后请求温度详细信息
export function reqOrderDetail(params) {
    return request({
        url: `${base}/api/temperature/detail?order_code=${params.code}&token=${params.token}`,
        method: 'get'
    })
}

//删除某条温度数据
export function deleteOrderDetail(params) {
    return request({
        url: `${base}/api/order/trajectory/delete`,
        method: 'delete',
        data: params
    })
}

//新增温度详情
export function addOrderDetail(params) {
    return request({
        url: `${base}/api/order/trajectory/add`,
        method: 'post',
        data: params
    })
}

//查询并展示物流节点的页面
//展示物流公司
export function reqTransCompany(params) {
    return request({
        url: `${base}/api/auth/logistics/box?token=${params}`,
        method: 'get'
    })
}

//根据快递单号查询物流信息
export function reqTransInfo(params) {
    return request({
        url: `${base}/api/order/trajectory/detail`,
        method: 'post',
        data: params
    })
}
// 通过订单号查询运单的运单编号和id
export function detailWaybillList(params) {
    return request({
        url: `${base}/api/order/detail/waybillList`,
        method: 'post',
        data: params
    })
}
//根据设备号等等查询温度和gps数据
export function reqTempAndGps(params) {
    return request({
        url: `${base}/api/temperature/thirdparty/data?order_code=${params.code}&firm=${params.firm}&device_id=${params.device_id}&start_time=${params.start_time}&end_time=${params.end_time}`,
        method: 'get'
    })
}

// 获取三地地区
export function reqRegion() {
    return request({
        url: `${base}/api/static/area`,
        method: 'get'
    })
}

//获取表头字段列表  
export function dynamicHeaderItemsList(params) {
    return request({
        url: `${base}/api/dynamicHeaderItems/list`,
        method: 'post',
        data: params
    })
}

//获取模块id API 接口
export function dynamicHeaderList(params) {
    return request({
        url: `${base}/api/dynamicHeader/list`,
        method: 'post',
        data: params
    })
}

//保存需要显示的表头字段 API接口  
export function dynamicHeaderCreate(params) {
    return request({
        url: `${base}/api/dynamicHeaderUser/create`,
        method: 'post',
        data: params
    })
}

//用户设定的表头字段 API接口 
export function dynamicHeaderUserList(params) {
    return request({
        url: `${base}/api/dynamicHeaderUser/list`,
        method: 'post',
        data: params
    })
}